package top.healthylife.gateway.platform.tc.api.api;


import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import top.healthylife.gateway.core.service.ParentFace;
import top.healthylife.gateway.dto.annotation.ApiServiceExplain;
import top.healthylife.gateway.platform.tc.api.util.TcHttpUtil;
import top.healthylife.gateway.platform.tc.dto.riskscore.req.TcReqComprehensiveInfoRiskScoreDto;
import top.healthylife.gateway.platform.tc.dto.riskscore.res.TcResComprehensiveInfoRiskScoreDto;

/**
 * @author GaoZeXi
 * @date 2021/7/20 13:19
 */
@Slf4j
@Service
@ApiServiceExplain(price = 20, apiName = "综合信息风险评分(增强版)", docUrl = "http://api.tcredit.com/norns/service/cas/doLogin" +
        "?service=http://api.tcredit.com/odin/user/sso", info = "根据姓名、身份证号查询所对应的风险分值")
public class TcComprehensiveInfoRiskScoreAPi implements ParentFace<TcReqComprehensiveInfoRiskScoreDto, TcResComprehensiveInfoRiskScoreDto> {

    static final String URL = "http://api.ypcredit.com/integration/getScoreInfoPro";

    @Override
    public TcResComprehensiveInfoRiskScoreDto execute(TcReqComprehensiveInfoRiskScoreDto dto) {
        return TcHttpUtil.getApiData(URL, dto, TcResComprehensiveInfoRiskScoreDto.class);
    }
}
